package com.com.itext.day1;

import com.itextpdf.io.image.ImageDataFactory;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Image;
import com.itextpdf.layout.element.Paragraph;
//测试图片
public class demo3 {
    public static void main(String[] args) throws Exception {
        //可以编写的pdf文件
        PdfWriter writer = new PdfWriter("D:\\测试pdf\\day1_3.pdf");
        PdfDocument pdf = new PdfDocument(writer);
        Document document = new Document(pdf);
        Image man = new Image(ImageDataFactory.create("D:\\testImage\\a.jpg"));
        Image woman = new Image(ImageDataFactory.create("D:\\testImage\\a.jpg"));
        Paragraph p = new Paragraph("The quick brown").add(man).add("man and woman").add(woman);
        document.add(p);
        document.close();
    }
}
